package t4;

import java.util.Calendar;
import java.util.Scanner;

import t4bean.CustomerBean;
import t4bean.StallBean;

/**
 * 
 * 输入购买水果的相关信息
 */
public class CinSellFruit {
	public StallBean cinSellFruit(StallBean stall, Scanner cin) {
		System.out.println("输入水果：");
		String fruitName1 = cin.nextLine();
		System.out.println("输入购买数量");
		Integer volume = Integer.parseInt(cin.nextLine());
		System.out.println("输入男女：");
		Integer sex = Integer.parseInt(cin.nextLine());
		CustomerBean customer = new CustomerBean("123", sex);
		SellFruit sellFruit = new SellFruit();
		Calendar cal = Calendar.getInstance();
		Integer h = cal.get(Calendar.HOUR_OF_DAY);
		if (h > 17) {
			sellFruit.sellFruitAfterFive(customer, stall, fruitName1, volume);
		} else {
			sellFruit.sellFruit(customer, stall, fruitName1, volume);
		}
		return stall;
	}
}
